/*
 * @lc app=leetcode.cn id=485 lang=javascript
 *
 * [485] 最大连续 1 的个数
 */

// @lc code=start
/**
 * @param {number[]} nums
 * @return {number}
 */
var findMaxConsecutiveOnes = function(nums) {
  let max = 0
  let point = 0
  for (let i = 0; i < nums.length; i++) {
    if (nums[i]) {
      point++
    } else {
      max = Math.max(max, point)
      point = 0
    }
  }
  max = Math.max(max, point)
  return max
};
// @lc code=end

